commonlibsse_ng\re\b/
BGSPerkEntry.rs1use core::ffi::c_void;
2
3use crate::re::Actor::Actor;
4use crate::re::BGSEntryPoint::EntryPoint;
5use crate::re::FormTypes::FormType;
6use crate::re::TESFile::TESFile;
7use crate::re::offsets_rtti::RTTI_BGSPerkEntry;
8use crate::re::offsets_vtable::VTABLE_BGSPerkEntry;
9use crate::rel::id::VariantID;
10
11#[repr(C)]
12#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13pub struct BGSPerkEntry {
14 pub vtable: *const BGSPerkEntryVtbl, pub header: Header, }
17const _: () = assert!(core::mem::size_of::<BGSPerkEntry>() == 0x10);
18
19impl BGSPerkEntry {
20 pub const RTTI: VariantID = RTTI_BGSPerkEntry;
22
23 pub const VTABLE: [VariantID; 1] = VTABLE_BGSPerkEntry;
27
28 pub const FORM_TYPE: FormType = FormType::Perk;
30
31 #[inline]
32 pub const fn get_rank(&self) -> u8 {
33 self.header.rank
34 }
35
36 #[inline]
37 pub const fn get_priority(&self) -> u8 {
38 self.header.priority
39 }
40}
41
42#[repr(C)]
43pub struct BGSPerkEntryVtbl {
44 CheckConditionFilters: fn(this: &mut BGSPerkEntry, num_args: u32, args: *mut c_void) -> bool, GetFunction: fn(this: &mut BGSPerkEntry) -> EntryPoint, GetFunctionData: fn(this: &BGSPerkEntry) -> *mut c_void, CxxDrop: fn(this: &mut BGSPerkEntry),
48 GetType: fn(this: &BGSPerkEntry) -> PERK_ENTRY_TYPE_CEnum, ClearData: fn(this: &mut BGSPerkEntry), InitItem: fn(this: &mut BGSPerkEntry, owner: *mut TESFile), Load: fn(this: &mut BGSPerkEntry, file: *mut TESFile) -> bool, SetParent: fn(this: &mut BGSPerkEntry), GetID: fn(this: &BGSPerkEntry) -> u16, ApplyPerkEntry: fn(this: &mut BGSPerkEntry, actor: *mut Actor), RemovePerkEntry: fn(this: &mut BGSPerkEntry, actor: *mut Actor), }
57
58#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
59#[repr(C)]
60pub struct Header {
61 rank: u8, priority: u8, unk2: u16, unk4: u32, }
66const _: () = assert!(core::mem::size_of::<Header>() == 0x8);
67
68#[commonlibsse_ng_derive_internal::ffi_enum]
69#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
70#[repr(u32)]
71pub enum PERK_ENTRY_TYPE {
72 Quest = 0,
73 Ability = 1,
74 EntryPoint = 2,
75}